#include<stdio.h>
#include<stdlib.h>

int main()
{
    while(1)
    {
         int x,y;
         int left = 0, right = 0, up = 0, below = 0;
         
         int i = 0;
         for (;;++i)
         {
             scanf("%d%d", &x, &y);
             if(x == 0 && y == 0)
                  break;
             if(left == 0 && right == 0 && up == 0 && below == 0)
             {
                  left = right = x;
                  up = below = y;
             }
             else
             {
                 if(x < left)
                      left = x;
                 else if (x > right)
                      right = x;
                 
                 if(y < below)
                      below = y;
                 else if (y > up)
                      up = y;    
             }
         }
         if(i == 0)
              break;

         printf("%d %d %d %d\n", left, below, right, up);         
    }
    system("pause");
    return 0;    
}
